package com.tina.entity;

import lombok.Data;

/**
 * @author Tina
 * @version 1.0
 * @since 2021/10/29 17:13
 **/
@Data
public class GraphWorkBean {
    /**
     * 资源名
     */
    private String name;
    private Integer consumers;
    private Integer count;
    /**
     * 上级资源
     */
    private String inputQueue;
    /**
     * 数据来源
     */
    private String resource;
    /**
     * 显示名称
     */
    private String label;

    public GraphWorkBean() {

    }

    public GraphWorkBean(String name, String inputQueue, String resource, String label, String type) {
        this.count = 1;
        if ("up".equals(type)) {
            this.consumers = 1;
        } else if ("down".equals(type)) {
            this.consumers = 2;
        } else {
            this.consumers = 0;
            this.count = 200;
        }
        this.name = name;
        this.inputQueue = inputQueue;
        this.resource = resource;
        this.label = label;
    }
}
